<?php
defined('IN_IA') or exit('Access Denied');
global $_W, $_GPC;
$id = intval($_GPC['id']);
if ($id > 0) {
	$poster = pdo_fetch("SELECT * FROM " . tablename('bsht_tbk_poster') . " WHERE uniacid = :uniacid", array(':uniacid' => $_W['uniacid']));
	$yaoqinguser = pdo_fetch('SELECT * FROM ' . tablename($this->tableuser) . ' WHERE uniacid = :uniacid AND id = :id', array(':uniacid' => $_W['uniacid'], ':id' => $id));
	$postuser1 = pdo_fetch('SELECT * FROM ' . tablename($this->tableuser) . ' WHERE uniacid = :uniacid AND uid = :uid', array(':uniacid' => $_W['uniacid'], ':uid' => $yaoqinguser['helpid']));
	$postuser2 = pdo_fetch('SELECT * FROM ' . tablename($this->tableuser) . ' WHERE uniacid = :uniacid AND uid = :uid', array(':uniacid' => $_W['uniacid'], ':uid' => $postuser1['helpid']));
	load()->model('mc');
	mc_credit_update($yaoqinguser['uid'], 'credit1', "-" . $yaoqinguser['score'], array(0, '违规邀请,扣除【' . $yaoqinguser['score'] . '】积分'));
	mc_credit_update($postuser1['uid'], 'credit1', "-" . $yaoqinguser['cscore'], array(0, '邀请的下级违规,扣除【' . $yaoqinguser['cscore'] . '】积分'));
	if ($postuser2) {
		mc_credit_update($postuser2['uid'], 'credit1', "-" . $yaoqinguser['pscore'], array(0, '邀请的下下级违规,扣除【' . $yaoqinguser['pscore'] . '】积分'));
	}
	pdo_update($this->modulename . "_user", array('helpid' => '0'), array('id' => $id));
	message('操作成功.', referer());
}
message('非法访问.');